package com.zth.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.zth.mapper.LinkMapper;
import com.zth.pojo.Link;
import com.zth.service.LinkService;

@Service
@Transactional
public class LinkServiceImpl implements LinkService{
	@Autowired
	private LinkMapper linkMapper;
	@Override
	public List<Link> linkAll(int page, int pageSize) {
		PageHelper.startPage(page,pageSize);
		return linkMapper.linkAll();
	}
	@Override
	public int add(Link link) {
		// TODO Auto-generated method stub
		return linkMapper.add(link);
	}
	@Override
	public Link linkById(int link_id) {
		
		return linkMapper.linkById(link_id);
	}
	@Override
	public int edit(Link link) {
		return linkMapper.edit(link);
	}
	@Override
	public int deleteBatch(int[] ids) {
		return linkMapper.deleteBatch(ids);
	}

}
